import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * 读取资源文件的方法
 * @author 赵超
 */
public class ConfigUtil {

	private static final String filePath = "/mail.properties";

	private static Properties properties;

	static {
		InputStream inputStream = ConfigUtil.class.getResourceAsStream(filePath);
		properties = new Properties();
		try {
			properties.load(inputStream);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	/**
	 * 获取配置文件属性值
	 * @param key	属性名
	 * @return
     */
	public static String getProperties(String key) {
		return properties.getProperty(key).trim();
	}

}